lock down hypercall continuation encoding masks
authorJan Beulich <jbeulich@suse.com>
Thu, 11 Dec 2014 16:13:04 +0000 (17:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 11 Dec 2014 16:13:04 +0000 (17:13 +0100)
commit4ef6b5f16c8a91cf6592f8817720a9de95b7052c
tree0ec840a4f0e32d23f7a6ef746277b79135feeb12
parent4d1308afaafa43ff68d6ecc493e36ee8f3ac9942
lock down hypercall continuation encoding masks

Andrew validly points out that even if these masks aren't a formal part
of the hypercall interface, we aren't free to change them: A guest
suspended for migration in the middle of a continuation would fail to
work if resumed on a hypervisor using a different value. Hence add
respective comments to their definitions.

Additionally, to help future extensibility as well as in the spirit of
reducing undefined behavior as much as possible, refuse hypercalls made
with the respective bits non-zero when the respective sub-ops don't
make use of those bits.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Release-Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/mm.c
xen/arch/x86/x86_64/compat/mm.c
xen/arch/x86/x86_64/mm.c
xen/common/compat/grant_table.c
xen/common/grant_table.c
xen/common/mem_access.c
xen/common/memory.c
xen/include/xen/hypercall.h